package com.allwees.bs.module.core.datapermission.rest;

import com.allwees.bs.core.modelbase.vo.R;
import com.allwees.bs.module.core.datapermission.RuleCache;
import com.allwees.bs.module.core.rest.BaseApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 重新加载RuleCache
 *
 * @author yangylsky
 *
 */
@RestController
@RequestMapping("/backstage/api/sys/datapermission")
public class RuleCacheApi extends BaseApi {
	@Autowired
	private RuleCache ruleCache;

	@GetMapping("/reload_rule_cache")
	public R reload() {
		ruleCache.reloadCache();
		return R.ok();
	}
}
